home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (C) 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- #ifndef _DAY_VIEW_
- #define _DAY_VIEW_
-
- #include <Vk/VkWindow.h>
- #include <Vk/VkApp.h>
- #include <Vk/VkScroll.h>
- #include "TimeEntry.h"
- #include "TimeGrid.h"
-
- class VCal;
- class MemoryInfo;
- class Entry;
- class RepeatingEntry;
- class EntryDialog;
- class VkRepeatButton;
- class VkPopupMenu;
- class VkMenu;
- class VkMenuItem;
-
- typedef struct {
- EntryDialog *dialog;
- TimeEntry *time;
- } DayViewInfo;
-
- class DayView : public VkWindow {
- public:
- DayView(VCal *owner, const char *docName);
- ~DayView();
-
- virtual const char* className();
-
- int day() { return _day; }
- int month() { return _month; }
- int year() { return _year; }
- void selectDate(int day, int month, int year, MemoryInfo *dayInfo,
- RepeatingEntry *repeating);
- void unselect();
- MemoryInfo *info() { return _info; }
- RepeatingEntry *repeating() { return _repeating; }
- void entryChanged(EntryDialog *);
- int eraseEntry(Entry *entry);
- void updateTime();
- void scrollToCurrentTime();
- void scrollToBeginning();
- void scrollToTime(int time);
-
- protected:
- virtual Widget setUpInterface(Widget parent);
- virtual void handleWmDeleteMessage();
-
- void fileMenu();
- void displayMenu();
- void entryMenu();
- void updateHeader();
- void initialExpose();
- void restrictedChanged(Boolean restricted);
- void notifyOwner(Entry *entry, Entry *oldEntry = NULL);
- void scrollProc(Widget w, XtPointer client_data, XtPointer call_data);
- void drawTrough(VkScrollCallback *cb);
- void annotateEntry(Entry *entry, int width, int height, Pixmap pixmap);
- void doDayPrev(Widget w, XtPointer client_data, XtPointer call_data);
- void doDayNext(Widget w, XtPointer client_data, XtPointer call_data);
- void displayToday();
- void weekdayMenu(VkMenu *parent);
- void selectWeekday(int day);
-
- void initEntries();
- void displayEntries();
- void hideEntries();
- void eraseEntries();
- void initEntry(Entry *entry);
- void displayEntry(Entry *entry);
- void hideEntry(Entry *entry);
- void entryCallback(Widget w, TimeEntryCallback *cb);
- Entry *findEntry(Widget w);
- void entryModified(Entry *entry, TimeEntryReason reason);
- void deleteEntry(Entry *entry);
- void doQuit();
- void gridCallback(TimeGridCallback *cb);
- Entry *createEntry(int start, int length);
- void selectEntry(Entry *entry, Boolean makeModified = False);
- void entryDialog(Entry *entry);
- Entry *findDialogEntry(EntryDialog *dialog);
- void removeEntry(Entry *entry);
- void addEntry(Entry *entry);
- void scheduleResetState();
- void setMenuEntry(TimeEntry *entry);
- void entryAttributesMenu();
- void entryDeleteMenu();
-
- static void quit_menu(Widget w, XtPointer client_data, XtPointer call_data);
- static void restricted_menu(Widget w, XtPointer client_data,
- XtPointer call_data);
- static void day_select(Widget w, XtPointer client_data, XEvent *event);
- static void weekday_menu(Widget w, XtPointer client_data,
- XtPointer call_data);
- static void entry_stub(Widget w, XtPointer client_data, XtPointer call_data);
- static void grid_stub(Widget w, XtPointer client_data, XtPointer call_data);
- static void attributes_menu(Widget w, XtPointer client_data,
- XtPointer call_data);
- static void delete_menu(Widget w, XtPointer client_data,
- XtPointer call_data);
- static Boolean reset_state(XtPointer call_data);
- static void save_text(Widget w, XtPointer client_data, XtPointer call_data);
- static void display_overview(Widget w, XtPointer client_data,
- XtPointer call_data);
- static void entry_attributes(Widget w, XtPointer client_data,
- XtPointer call_data);
- static void entry_delete(Widget w, XtPointer client_data,
- XtPointer call_data);
-
- Widget form, header, tsForm;
- VkRepeatButton *dayPrev, *dayNext;
- VCal *owner;
- int numSlots, timeInterval, subdivisions, timeSlotSnap;
- int _day, _month, _year, _lastTime;
- MemoryInfo *_info;
- RepeatingEntry *_repeating;
- Boolean restricted;
- int restrictStart, restrictEnd;
- XtCallbackProc callback;
- caddr_t callbackData;
- VkScroll *scroll;
- int scrollCount;
- GC troughGC, timeGC, tileGC;
- Pixmap tile;
- TimeGrid *grid;
- int defaultLength;
- VkPopupMenu *entryPopup, *repeatingEntryPopup;
- Entry *menuEntry;
- VkMenuItem *entryAttrItem, *entryDeleteItem, *entryDeleteEverywhereItem;
- TimeEntry *lastMenuEntry;
- };
-
- #endif
-